#include "geometry.h"
#include <math.h>

using namespace m3d;

SVector3F m3d::SphericalToCartesian( double x, double y, double radius ) //( float rho, float phi, float theta )
{
	m3d::SVector3F v;
	double rho = radius, phi = x, theta = y;

	v.x		= (float) (rho*sin(theta)*sin(phi));
	v.y		= (float) -(rho*cos(theta));
	v.z		= (float) (rho*sin(theta)*cos(phi));
	return v;
}
